﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MSMQ.Triggers
{
	/// <summary>
	/// Manages a MSMQ rule.
	/// </summary>
	public class Rule
	{
		#region Constructor(s)

		/// <summary>
		/// Creates a <see cref="Rule"/>.
		/// </summary>
		public Rule()
		{
			_params = new List<string>();
			_interactsWithDesktop = true;
		}

		#endregion

		#region Properties

		private string _id;
		/// <summary>
		/// Gets or sets the identifier for the rule.
		/// </summary>
		public string Id
		{
			get { return _id; }
			internal set { _id = value; }
		}

		private string _name;
		/// <summary>
		/// Gets or sets the name of the rule.
		/// </summary>
		public string Name
		{
			get { return _name; }
			set { _name = value; }
		}

		private string _description;
		/// <summary>
		/// Gets or sets the description for the rule.
		/// </summary>
		public string Description
		{
			get { return _description; }
			set { _description = value; }
		}

		private string _exePath;
		/// <summary>
		/// Gets or sets the executable path the rule executes if the condition is met.
		/// </summary>
		public string ExePath
		{
			get { return _exePath; }
			set { _exePath = value; }
		}

		private string _condition;
		/// <summary>
		/// Gets or sets the condition for the rule, which if it evaluates to true, will execute the specified executable.
		/// </summary>
		public string Condition
		{
			get { return _condition; }
			set { _condition = value; }
		}

		private bool _interactsWithDesktop;
		/// <summary>
		/// Gets or sets whether the executable is allowed to interact with the desktop.
		/// </summary>
		public bool InteractsWithDesktop
		{
			get { return _interactsWithDesktop; }
			set { _interactsWithDesktop = value; }
		}

		private List<string> _params;
		/// <summary>
		/// Gets the parameters to pass to the executable.
		/// </summary>
		public List<string> Params
		{
			get { return _params; }
		}

		#endregion
	}
}